<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#loginForm").submit(function(){
			if($(":input[name='memberId']").val()==""){
				alert("아이디를 입력하세요");
				return;
			}
			if($(":input[name='memberPassword']").val()==""){
				alert("비번을 입력하세요");
				return;
			}
		})
	})
	function windowOpen(){
		window.open("${initParam.root}member/findIdandPassword.moja","popup","width=480, height=450");
	}
</script>
 
 <div id="loginForm">
 	<div align="center">
 <c:choose>
 	<c:when test="${sessionScope.mvo==null}">
 <img src="${initParam.root }img/loginTitle.jpg">
 <br><br>
		<form id="loginForm" name="loginForm" action="${initParam.root}member/login.moja" method="post" >	
 			<input class="input_form" type="text" name="memberId"  placeholder="id">
			<input class="input_form" type="password" name="memberPassword"  placeholder="password">
			<input class="login_button" type="submit" value="LOGIN" >
			<div align="left">
			<a href="${initParam.root}member/register_view.moja" class="menu_font_red">Sign In</a><br>
			<a href="#" onclick = "windowOpen()" class="menu_font_red">Lost ID/Password?</a><br>
			</div>
		</form>
	 </c:when>
	 <c:otherwise>
	 <img src="${initParam.root }img/loginTitle.jpg">
	 <br><br>
 			
 			<c:choose>
 				<c:when test= "${sessionScope.mvo.memberPoint==-1}">
 				<font size="3px" face="돋음"><b>[관리자 ${sessionScope.mvo.memberId}님 로그인]</b><br><br>
 				<a href="${initParam.root }member/update_view.moja"><img src="${initParam.root }img/logtab1.jpg"></a>
 				<a href="${initParam.root }member/messageStorage_view.moja"><img src="${initParam.root }img/logtab3.jpg"></a>
 				<a href="${initParam.root }member/logout.moja"><img src="${initParam.root }img/logtab4.jpg"></a>
 				</c:when>
 			
 			<c:otherwise>
 			<font size="3px" face="돋음"><b>[${sessionScope.mvo.memberId} ( ${sessionScope.mvo.memberName} )님 로그인]</b><br><br>
			" JJOM's 사이트에 <br>오신것을 환영합니다. "<br><br></font>
			<hr>
			<div align="left">
			<font color="#000000" size="2px"><b>회원등급 : </b> ${sessionScope.mvo.grade }</font>
			<br><br>
			<font color="#000000" size="2px"><b>보유 포인트 : </b>${sessionScope.mvo.memberPoint}<b>쫌</b></font>
			<br><br>
			<font color="#000000" size="2px"><b>보유머니 : </b>${sessionScope.mvo.memberMoney}<b>원</b>
			<a href="${initParam.root }member/payment_view.moja">충전☞</a></font>
			<br><br>
			</div>
			<a href="${initParam.root }member/update_view.moja"><img src="${initParam.root }img/logtab1.jpg"></a>
			<a href="${initParam.root }member/payment_view.moja"><img src="${initParam.root }img/logtab2.jpg"></a>
			<a href="${initParam.root }member/messageStorage_view.moja"><img src="${initParam.root }img/logtab3.jpg"></a>
			<a href="${initParam.root }member/logout.moja"><img src="${initParam.root }img/logtab4.jpg"></a>
 			</c:otherwise>
 			
 			</c:choose>
 			
	 </c:otherwise>
 </c:choose>
	</div>
</div>
  
  
  
  
  
  
  
  
  
  